<template>
    <div class="message_container">
        <div class="message_list">
            <div class="user">
                <div class="user_left"><img src="../images/FvBrVWxsllgDc-G5wqXLAaXpo8qt.jpg" alt=""></div>
                <div class="user_middle">
                    <h5>科技圈大小事</h5>
                    <p>来自用户<span>nature42</span><a href="#">17:42</a></p>
                </div>
                <div class="user_right">
                    <div class="triangle"></div>
                </div>
            </div>
            <div class="content">
                <div class="words">
                    <span>
                    【阿里巴巴入股B站，占B站总股本约8%】阿里巴巴向美国证券交易委员会提交报告，宣布通过全资子公司淘宝中国入股B站近2400万股, 持股比例占B站总股本约8%。当前淘宝与B站的业务合作正顺利推进，B站上一大批拥有百万粉丝的优质原生UP主正加速入驻淘宝，而淘宝二次元平台也为他们量身定制了全方位的商业化方案。
                    </span>
                </div>
                <div class="picture">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                </div>
            </div>
            <div class="handler">
                <div class="zan">
                    <span class="iconfont icon-zan"></span>
                    <span>0</span>
                </div>
                <div class="comment" @click="publishComment">
                    <span class="iconfont icon-pinglun"></span>
                    <span>0</span>
                </div>
                <div class="zhuanfa">
                    <span class="iconfont icon-zhuanfa"></span>
                </div>
            </div>
            <div class="commentList" v-show="commentFlag">
                <comment></comment>
            </div>
        </div>
        <div class="message_list">
            <div class="user">
                <div class="user_left"><img src="../images/FvBrVWxsllgDc-G5wqXLAaXpo8qt.jpg" alt=""></div>
                <div class="user_middle">
                    <h5>科技圈大小事</h5>
                    <p>来自用户<span>nature42</span><a href="#">17:42</a></p>
                </div>
                <div class="user_right">
                    <div class="triangle"></div>
                </div>
            </div>
            <div class="content">
                <div class="words">
                    <span>
                    【阿里巴巴入股B站，占B站总股本约8%】阿里巴巴向美国证券交易委员会提交报告，宣布通过全资子公司淘宝中国入股B站近2400万股, 持股比例占B站总股本约8%。当前淘宝与B站的业务合作正顺利推进，B站上一大批拥有百万粉丝的优质原生UP主正加速入驻淘宝，而淘宝二次元平台也为他们量身定制了全方位的商业化方案。
                    </span>
                </div>
                <div class="picture">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                    <img src="https://cdn.ruguoapp.com/FpezoB5-LOXMgqZDXOIenSK-7ArD.jpeg?imageMogr2/auto-orient/thumbnail/400x2000%3E/quality/70/interlace/1"
                         alt="">
                </div>
            </div>
            <div class="handler">
                <div class="zan">
                    <span class="iconfont icon-zan"></span>
                    <span>0</span>
                </div>
                <div class="comment">
                    <span class="iconfont icon-pinglun"></span>
                    <span>0</span>
                </div>
                <div class="zhuanfa">
                    <span class="iconfont icon-zhuanfa"></span>
                </div>
            </div>
        </div>

    </div>
</template>

<script>
    import comment from '../subcomponents/Comments.vue'

    export default {
        data() {
            return {
                commentFlag: false
            };
        },
        methods: {
            publishComment() {
                this.commentFlag = !this.commentFlag;
            }
        },
        components: {
            comment
        }
    }
</script>

<style type="text/scss" lang="scss" scoped>
    .message_container {
        width: 100%;
        overflow: hidden;

        .message_list {
            width: 100%;
            margin-top: 5px;
            background-color: white;

            .user {
                width: 93%;
                padding: 20px;
                display: flex;
                justify-content: space-between;

                .user_left {
                    width: 50px;
                    height: 50px;
                    border-radius: 5px;
                    overflow: hidden;

                    img {
                        width: 100%;
                    }
                }

                .user_middle {
                    width: 476px;
                    height: 45px;
                    padding-top: 5px;

                    h5 {
                        color: #383838
                    }

                    p {
                        margin-top: 10px;
                        font-size: 13px;
                        color: #bfbfbf;

                        span {
                            color: #03a9f4;
                            margin-left: 5px;
                            margin-right: 15px;
                            cursor: pointer;
                        }

                        a {
                            color: #bfbfbf;
                        }
                    }
                }

                .user_right {
                    width: 14px;
                    height: 50px;

                    .triangle {
                        width: 0.5em;
                        height: 0.5em;
                        border-top: 1.5px solid #d9d9d9;
                        border-right: 1.5px solid #d9d9d9;
                        transform: rotate(135deg);
                        cursor: pointer;
                    }
                }
            }

            .content {
                width: 100%;

                .words {
                    width: 83%;
                    margin-left: 5em;
                    font-size: 14px;
                    line-height: 20px;
                    color: #404040;
                }

                .picture {
                    width: 70%;
                    display: flex;
                    justify-content: flex-start;
                    flex-wrap: wrap;
                    margin-left: 4.5em;
                    margin-top: 0.5em;

                    img {
                        width: 120px;
                        height: 120px;
                        margin-top: 0.5em;
                        margin-right: 0.5em;
                        cursor: pointer;
                    }
                }
            }

            .handler {
                width: 50%;
                height: 46px;
                display: flex;
                justify-content: space-around;
                margin-left: 2em;

                div {
                    margin-top: .8em;
                    cursor: pointer;
                    user-select: none;

                    span:last-of-type {
                        color: #ccc;
                        font-size: 15px;
                    }

                    .icon-zan, .icon-pinglun {
                        color: #ccc;
                    }

                    .icon-zan:hover, .icon-pinglun:hover, .icon-zhuanfa:hover {
                        color: gray;
                    }
                }
            }

            .commentList {
                width: 100%;
            }
        }
    }
</style>